//
// Created by cdm on 15/7/27.
// Copyright (c) 2015 xueyinyue. All rights reserved.
//

#import "User.h"
#import "AppConfig.h"

NSString *const kUserPropertyUser = @"user";

@implementation User {

}

- (instancetype)initWithDic:(NSDictionary *)dic
{
    self = [super init];
    if (!self)
    {
        return nil;
    }
    
    [self setValuesForKeysWithDictionary:dic];
    return self;
}

+ (instancetype)userWithDic:(NSDictionary *)dic
{
    return [[self alloc] initWithDic:dic];
}

#pragma mark - Helper Method
- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict
{
    id object = [dict objectForKey:aKey];
    return [object isEqual:[NSNull null]] ? nil : object;
}

@end